package com.gupao.javavip.quartz.job;

import lombok.extern.apachecommons.CommonsLog;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * @author King
 * @Classname QuartzJob
 * @Description
 * @Date 2020/5/1 14:51
 */
@DisallowConcurrentExecution
@CommonsLog
public class QuartzJob extends QuartzJobBean {
    @Autowired
    private JobService jobService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) {
        log.info("------------- 定时任务开始 -------------");
        jobService.doJob();
        log.info("------------- 定时任务结束 -------------");
    }
}
